package com.artPreter.service.impl;


import com.artPreter.mapper.BannerMapper;
import com.artPreter.pojo.Banner;
import com.artPreter.service.IBannerService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 文章内容表 服务实现类
 * </p>
 *
 * @author jarvis
 * @since 2024-12-02
 */
@Service
public class BannerServiceImpl extends ServiceImpl<BannerMapper, Banner> implements IBannerService {

    @Override
    public List<Banner> getList(int i) {
        List<Banner> result = new ArrayList<>();
        LambdaQueryWrapper<Banner> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.last( " limit "+i);
        lambdaQueryWrapper.eq(Banner::getStatus,1);
        result = this.baseMapper.selectList(lambdaQueryWrapper);
        return result;
    }
}
